package com.ruoyi.background.service.impl;

import com.ruoyi.background.domain.AppRankUser;
import com.ruoyi.background.mapper.AppRankUserMapper;
import com.ruoyi.background.service.IAppRankUserService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户排名表Service业务层处理
 *
 * @author susu
 * @date 2024-08-22
 */
@Service
public class AppRankUserServiceImpl implements IAppRankUserService {
    @Autowired
    private AppRankUserMapper appRankUserMapper;

    /**
     * 查询用户排名表
     *
     * @param id 用户排名表主键
     * @return 用户排名表
     */
    @Override
    public AppRankUser selectAppRankUserById(String id) {
        return appRankUserMapper.selectAppRankUserById(id);
    }

    @Override
    public AppRankUser selectAppRankUserByUserId(Long userId) {
        return appRankUserMapper.selectAppRankUserByUserId(userId);
    }

    /**
     * 查询用户排名表列表
     *
     * @param appRankUser 用户排名表
     * @return 用户排名表
     */
    @Override
    public List<AppRankUser> selectAppRankUserList(AppRankUser appRankUser) {
        return appRankUserMapper.selectAppRankUserList(appRankUser);
    }

    /**
     * 新增用户排名表
     *
     * @param appRankUser 用户排名表
     * @return 结果
     */
    @Override
    public int insertAppRankUser(AppRankUser appRankUser) {
        appRankUser.setCreateTime(DateUtils.getNowDate());
        return appRankUserMapper.insertAppRankUser(appRankUser);
    }

    /**
     * 修改用户排名表
     *
     * @param appRankUser 用户排名表
     * @return 结果
     */
    @Override
    public int updateAppRankUser(AppRankUser appRankUser) {
        return appRankUserMapper.updateAppRankUser(appRankUser);
    }

    /**
     * 批量删除用户排名表
     *
     * @param ids 需要删除的用户排名表主键
     * @return 结果
     */
    @Override
    public int deleteAppRankUserByIds(String[] ids) {
        return appRankUserMapper.deleteAppRankUserByIds(ids);
    }

    /**
     * 删除用户排名表信息
     *
     * @param id 用户排名表主键
     * @return 结果
     */
    @Override
    public int deleteAppRankUserById(String id) {
        return appRankUserMapper.deleteAppRankUserById(id);
    }
}
